<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
| 小程序的api 路由写在这里
*/

Route::group(['prefix' => 'v1/user/ticket', 'middleware' => ['web', 'client.auth']],function() {
    //查询代金券
    Route::get('/lists','API\UserTicketController@apiSearch');
    Route::post('/store', 'API\UserTicketController@store');
    Route::get('/query/{id}','API\UserTicketController@show')->where('id', '[0-9]+');
    Route::delete('/{id}','API\UserTicketController@destroy')->where('id', '[0-9]+');
    Route::post('/{id}','API\UserTicketController@update')->where('id', '[0-9]+');
});

Route::group(['prefix' => 'v1/comment', 'middleware' => ['web', 'client.auth']],function() {
    //查询代金券
    Route::get('/lists','API\UserCommentAPIController@apiSearch');
    Route::post('/store', 'API\UserCommentAPIController@store');
});

Route::group(['prefix' => 'v1/user-meeting', 'middleware' => ['web', 'client.auth']],function() {
    //查询代金券
    Route::get('/lists','API\UserMeetingAPIController@apiSearch');
    Route::post('/store', 'API\UserMeetingAPIController@store');
    Route::post('/{id}/posting', 'API\UserMeetingAPIController@updatePosting');
});

Route::group(['prefix' => 'v1/user-tickets', 'middleware' => ['web', 'client.auth']],function() {
    //查询代金券
    Route::get('/lists','API\UserTicketController@apiSearch');
    Route::post('/store', 'API\UserTicketController@store');
});

Route::post('v1/user/login', 'API\UserController@login')->middleware('api');
Route::get('v1/upload/token','API\AppController@uploadAction');
Route::post('v1/upload/picture','API\AppController@uploadImage');

Route::group(['prefix' => 'v1/meeting', 'middleware' => ['web', 'client.auth']],function() {
    //查询代金券
    Route::get('/lists','API\MeetingAPIController@apiSearch');
    Route::get('/query/{id}','API\MeetingAPIController@show')->where('id', '[0-9]+');
    // 嘉宾
    Route::get('/{id}/guests','API\MeetingGuestAPIController@apiSearch')->where('id', '[0-9]+');
    // 回顾
    Route::get('/{id}/overviews','API\MeetingOverviewAPIController@apiSearch')->where('id', '[0-9]+');
    // 报名
});
